package com.corpgovernment.organization.mapper;


import com.corpgovernment.organization.common.mybatis.TkMapper;
import com.corpgovernment.organization.entity.db.MbExpressAddress;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * MbSupplierProductMapper数据库操作接口类
 **/
@Repository
public interface MbExpressAddressMapper extends TkMapper<MbExpressAddress> {

    List<MbExpressAddress> findListByOrgIds(@Param("orgIds") List<String> orgIds);

    List<MbExpressAddress> listByUid(@Param("uid") String uid, @Param("selectVal") String selectVal);

    List<MbExpressAddress> listByOrgIdAndSelectVal(@Param("orgId") String orgId, @Param("uid") String uid, @Param("selectVal") String selectVal, @Param("type") Integer type);

    MbExpressAddress findUserRecentUseAddress(@Param("uid") String uid);

    List<MbExpressAddress> listByOrgId(String orgId);

    /**
     * 批量插入
     *
     * @param list
     */
    void insertSelectiveBatch(@Param("list") List<MbExpressAddress> list);

    /**
     * 批量更新(删除)
     *
     * @param list
     */
    void updateSelectiveBatch(@Param("list") List<MbExpressAddress> list);

    /**
     * 删除组织ID下的所有配送地址
     *
     * @param orgId
     * @return
     */
    int deleteByOrgId(@Param("orgId") String orgId);
}
